package com.neomanager.admin.dao;

import java.util.ArrayList;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.dao.DataAccessException;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class BannerDao extends SqlMapClientDaoSupport
{
	public Logger logger = Logger.getLogger(this.getClass());
	
	/**
	 *  배너, 알림판, etc  목록
	 */
	public ArrayList<Map<String, Object>> selectBannerInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("배너, 알림판, etc  정보 목록 DAO");
		@SuppressWarnings("unchecked")
		ArrayList<Map<String, Object>> mlist = (ArrayList<Map<String, Object>>) getSqlMapClientTemplate().queryForList("banner.selectBannerInfo", param);
		return mlist;
	}
	
	/**
	 * 배너, 알림판, etc  상세
	 */
	public Map<String, Object> selectBannerInfoById(Map<String, Object> param) throws DataAccessException
	{
		logger.info("배너, 알림판, etc 상세 DAO");
		@SuppressWarnings("unchecked")
		Map<String, Object> rs = (Map<String, Object>) getSqlMapClientTemplate().queryForObject("banner.selectBannerInfoById", param);
        return rs;
	}
	
	/**
	 *  배너, 알림판, etc  등록
	 */
	public void insertBannerInfo(Map<String, Object> param) throws DataAccessException
	{
		logger.info("배너, 알림판, etc  정보 등록 DAO");
		getSqlMapClientTemplate().insert("banner.insertBannerInfo", param);
		return;
	}
	
	/**
	 * 배너, 알림판, etc  수정
	 */	
	public void updateBannerInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("배너, 알림판, etc  수정 DAO");
		getSqlMapClientTemplate().update("banner.updateBannerInfo", param);
        return;
	}

	/**
	 * 배너, 알림판, etc  삭제
	 */	
	public void deleteBannerInfo(Map<String, Object> param) throws DataAccessException {
		logger.info("배너, 알림판, etc  삭제 DAO");
		getSqlMapClientTemplate().update("banner.deleteBannerInfo", param);
        return;
	}	
}


